import React from 'react';
import ReactDOM from 'react-dom/client';
// import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
//为了让组件导入时有ts类型提示, 需要一并安装 react-router-dom@5 和 @types/react-router-dom
import { HashRouter,BrowserRouter } from 'react-router-dom'

//BrowserRouter 实现的是history模式的路由  /index/home
//HashRouter 实现的是hash模式的路由       #/index/home
//注意: 整个应用程序只能使用一个路由管理组件
const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);
root.render(
  // <React.StrictMode>
     <BrowserRouter>
      <App />
     </BrowserRouter>
  // </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
